home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / blitz / efmuilibsrc.lha / EFMUILibSrc / mdl.asc < prev    next >
Text File  |  1998-02-03  |  1KB  |  57 lines

  1. ;mdl.bb2 --- MakeDefLibs
  2. ;Based on makedeflibs.bb2
  3. ;(c) 1997/98 Vivid Imagination
  4.  
  5. DEFTYPE.l
  6.  
  7. If WriteFile(0,"blitz2:deflibs")=0
  8.   NPrint "Error creating blitz2:deflibs":End
  9. EndIf
  10.  
  11. l.l=Lock_("blitzlibs:",-2)
  12. If l=0
  13.   NPrint "Error 'locking' blitzlibs:":End
  14. EndIf
  15.  
  16. e.l=AllocMem_(260,1)
  17. e2.l=AllocMem_(260,1)
  18.  
  19. Examine_ l,e
  20.  
  21. While ExNext_(l,e)
  22.   If Peek.l(e+4)>=0
  23.     d$="blitzlibs:"+Peek$(e+8)
  24.     l2=Lock_(&d$,-2)
  25.     If l2=0
  26.       NPrint "Error 'locking' ",d$:UnLock_ l:CloseFile 0:KillFile "blitz2:deflibs"
  27.       Goto freemem
  28.     EndIf
  29.     Examine_ l2,e2
  30.     While ExNext_(l2,e2)
  31.       If Peek.l(e2+4)<0   ;file?
  32.         f$=LCase$(Peek$(e2+8))
  33.         If Right$(f$,5)<>".info"
  34.           f$=d$+"/"+f$
  35.           If ReadFile(1,f$)
  36.             FileInput 1:FileOutput 0
  37.             Print Mkl$(Lof(1))
  38.             Print Inkey$(Lof(1))
  39.             CloseFile 1:DefaultOutput
  40.           Else
  41.             NPrint "Error reading file ",f$
  42.             UnLock_ l:UnLock_ l2:CloseFile 0:KillFile "blitz2:deflibs"
  43.             Goto freemem
  44.           EndIf
  45.         EndIf
  46.       EndIf
  47.     Wend
  48.     UnLock_ l2
  49.   EndIf
  50. Wend
  51. FileOutput 0:Print Mkl$(0):DefaultOutput
  52. UnLock_ l
  53.  
  54. CloseFile 0
  55.  
  56. freemem:FreeMem_ e,260:FreeMem_ e2,260
  57.